package com.yimu.ymblog.web.controller;


import com.yimu.ymblog.common.aspect.ApiOperationLog;
import com.yimu.ymblog.common.utils.Response;
import com.yimu.ymblog.web.service.FileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/file")
@Api(tags = "前台页面 文件模块")
public class FileController {

    @Autowired
    private FileService fileService;

    @PostMapping("/upload")
    @ApiOperation(value = "文件上传")
    @ApiOperationLog(description = "文件上传")
    public Response uploadFileFrontend(@RequestParam MultipartFile file) {
        return fileService.uploadFileFrontend(file);
    }

}